cmake_minimum_required(VERSION 3.16)
project(sql_MD)


set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Sql )
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Sql )

add_library(sql
  STATIC
  sqlite.cpp
)

add_executable(main main.cpp)
target_link_libraries(main
  PRIVATE 
  sql
  Qt${QT_VERSION_MAJOR}::Sql)

target_link_libraries(sql
  PRIVATE 
  Qt${QT_VERSION_MAJOR}::Sql)
